module.exports = function ($resource, $state, $http, $q, FileUploader, toaster) {
  
    return {
  
      restrict: 'AE',
      template: require('../views/allloglist.html'),
      replace: true,
      scope: {
        'saleobj': '=',
        'funobj': '=',
        'baseinfo': '=',
        'util': '=',
      },
      link: function (scope, elements, attrs) {
              /* 分页
          * ========================================= */
          scope.maxSize = 5;             //最多显示多少个按钮
          scope.bigCurrentPage = 1;      //当前页码
          scope.itemsPerPage = 10         //每页显示几条
          scope.searchform = {};
          scope.getlist = function () {
              var para = {
                  pageNo:scope.bigCurrentPage, 
                  pageSize:scope.itemsPerPage
              };
              para = angular.extend(scope.searchform, para);
              $resource('/api/as/ggc/touristFundsCapitalApplyAd/findLogList', {}, {}).
              save(para,function(res) {
                  console.log(para);
                  if (res.errcode !== 0) {
                      toaster.error({title:"",body:res.errmsg});
                      return;
                  }
                  console.log('数据');
                  console.log(res);
                  scope.objs = res.data.results;
                  scope.bigTotalItems = res.data.totalRecord;
                
              })
          };
          scope.getlist();

          scope.detail = function(item) {
              scope.item = item;
              var modalInstance = $modal.open({
                template: require('../views/superviseInfo.html'),
                controller: 'superviseInfo',
                size: 'lg',
                resolve: {
                  item: function () {
                      return scope.item;
                  },
                }
              });
              modalInstance.result.then(function (showResult) {	
                  scope.getlist();
              });
          };
      }
  }
}